<php>
	$this->display(tpl('head'));
	$iswrite_Template[$setting['iswrite_Template']]="checked";
	$webstate[$setting['webstate']]="checked";
	$qinghuancun[$setting['qinghuancun']]="checked";
	$delshangxian[$setting['delshangxian']]="checked";
	$ssl[$setting['ssl']]="checked";
	$after[$setting['html']]="selected";
	$url_rules[$setting['url_rules']]="checked";
	$index[$setting['index']]='selected';
	$is_log[$setting['is_log']]="checked";
	$cookie_is_en[$setting['cookie_is_en']]="checked";
</php>
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
  <legend>网站设置</legend>
</fieldset>
<style>
	.layui-form-select {
	    position: relative;
	    width: 30%;
	}
</style>
<form id="SETForm" class="layui-form" method="post">
	<table class="layui-table my-tabel">
		<tbody>
			<tr>
				<td>网站状态</td>
				<td>
					<input type="radio" name="web[webstate]" title="开启" value="1" {{$webstate[1] }}/>
            		<input type="radio" name="web[webstate]" title="关闭" value="0" {{$webstate[0] }}/>
            		<p>如果关闭了，则只能登陆后台。插件及模块都不可访问</p>
				</td>
			</tr>
			<tr>
				<td>网站状态</td>
				<td>
					<textarea class="layui-textarea my-input" placeholder="关闭原因" name="web[close_why]">{{$setting['close_why'] }}</textarea>
				</td>
			</tr>
			<tr>
				<td>默认首页</td>
				<td>
					<select name="web[index]" id="selection" class="my-input">
						<option value="" >请选择一个模块做为首页</option>
						<option value="home" {{$index['home'] }}>home</option>
						<foreach array="modular">
						<option value="{{$row['dir']	}}" {{$index[$row['dir']] }}>{{$row['name'] }}</option>
						</foreach>
					</select>
					<p>请选择一个模块作为首页</p>
				</td>
			</tr>
			<tr>
				<td>启用SSL(启用https服务)</td>
				<td>
					<input type="radio" name="web[ssl]" title="开启SSL" value="1" {{$ssl[1] }}/>
            		<input type="radio" name="web[ssl]" title="关闭SSL" value="0" {{$ssl[0] }}/>
				</td>
			</tr>
			<tr>
				<td>主域名</td>
				<td>
					<input name="web[weburl]" value="{{$setting['weburl'] }}" class="layui-input my-input" type="text">
				</td>
			</tr>
			<tr>
				<td>cookie有效域</td>
				<td>
					<input name="web[cookie_domain]"  value="{{$setting['cookie_domain'] }}" type="text" class="layui-input my-input">
					<p>请填写不带WWW.的一级域名</p>
				</td>
			</tr>
			<tr>
				<td>网站名称</td>
				<td>
					<input name="web[webname]" value="{{$setting['webname'] }}" id="webname" lay-verify="title" autocomplete="off" class="layui-input" type="text">
				</td>
			</tr>
			<tr>
				<td>SEO标题</td>
				<td>
					<input name="web[web_seo_webname]"  value="{{$setting['web_seo_webname'] }}" id="web_seo_webname" lay-verify="title" autocomplete="off" class="layui-input" type="text">
				</td>
			</tr>
			<tr>
				<td>SEO关键字</td>
				<td>
					<input name="web[web_seo_keywords]" value="{{$setting['web_seo_keywords'] }}" id="web_seo_keywords" lay-verify="title" autocomplete="off" class="layui-input" type="text">
				</td>
			</tr>
			<tr>
				<td>SEO描述信息</td>
				<td>
					<textarea name="web[web_seo_description]" class="layui-textarea">{{$setting['web_seo_description'] }}</textarea>
				</td>
			</tr>
			<tr>
				<td>工信部备案号</td>
				<td>
					<input name="web[miibeian_num]" value="{{$setting['miibeian_num'] }}" class="layui-input" type="text">
				</td>
			</tr>
			<tr>
				<td>允许上传文件的类型</td>
				<td>
					<input name="web[upfiles_types]"  class="layui-input layui-input-my" type="text" value="{{$setting['upfiles_types'] }}">
				</td>
			</tr>
			<tr>
				<td>Home模板选择</td>
				<td>
					<select name="web[select_template]">
						<foreach array="style['home']" key="path">
						<php>
							$selected='';
							if($path==C('select_template')){
								$selected="selected";
							}
						</php>
							<option value="{{$path }}" {{$selected }} > {{$row['name'] }}</option>
						</foreach>
					</select>
				</td>
			</tr>
			<tr>
				<td>Admin模板选择</td>
				<td>
					<select name="web[select_admin_template]">
						<foreach array="style['admin']" key="path">
							<php>
								$selected='';
								if($path==C('select_admin_template')){
									$selected="selected";
								}
							</php> 
							<option value="{{$path }}" {{$selected }} > {{$row['name'] }}</option>
						</foreach>
					</select>
				</td>
			</tr>
			<tr>
				<td>User模板选择</td>
				<td>
					<select name="web[select_user_template]">
						<foreach array="style['user']" key="path">
						<php>
							$selected='';
							if($path==C('select_user_template')){
								$selected="selected";
							}
						</php>
							<option value="{{$path }}" {{$selected }} > {{$row['name'] }}</option>
						</foreach>
					</select>
				</td>
			</tr>
			<tr>
				<td>模板引擎缓存</td>
				<td>
					<input type="radio" name="web[iswrite_Template]" title="实时缓存" value="1" {{$iswrite_Template[1] }}/>
            		<input type="radio" name="web[iswrite_Template]" title="只缓存一次" value="0" {{$iswrite_Template[0] }}/>
				</td>
			</tr>
			<tr>
				<td>加密字符串</td>
				<td>
					<input name="web[md5]" placeholder="随便输入字符即可"  class="layui-input layui-input-my" type="text" value="{{$setting['md5'] }}">
				</td>
			</tr>
			<tr>
				<td>COOKIE键值状态</td>
				<td>
					<input type="radio" name="web[cookie_is_en]" title="加密" value="1" {{$cookie_is_en[1] }}/>
            		<input type="radio" name="web[cookie_is_en]" title="不加密" value="0" {{$cookie_is_en[0] }}/>
				</td>
			</tr>
			<tr>
				<td>网址伪静态后戳名</td>
				<td>
					<select name="web[html]" id="selection">
						<option value=".html"	<?php echo $after[".html"] ?> >.html</option>
						<option value=".htm"	<?php echo $after[".htm"] ?>  >.htm</option>
						<option value=".shtml"	<?php echo $after[".shtml"] ?>>.shtml</option>
						<option value=".php"	<?php echo $after[".php"] ?>	>.php</option>
					</select>
				</td>
			</tr>
			<tr>
				<td>是否记录访问日志</td>
				<td>
					<input type="radio" name="web[is_log]" title="记录" value="1" {{$is_log[1] }}/>
            		<input type="radio" name="web[is_log]" title="不记录" value="0" {{$is_log[0] }}/>
            		<p>若果记录的话，位置{{RUNTIME_PATH }}access_logs/查看</p>
				</td>
			</tr>
			
			<tr>
				<td colspan="2" class="my_button center" align="center">
					<input type="hidden" name="step" id="step" value="post" />
					<button class="layui-btn">立即提交</button>
				</td>
			</tr>
		</tbody>
		</tbody>
	</table>
</form>
<script>
	layui.use(['form', 'layedit', 'laydate'], function() {
		var form = layui.form,
			layer = layui.layer,
			layedit = layui.layedit,
			laydate = layui.laydate;
	});
</script>

<?php $this->display(tpl('foot')); 
